package com.mmall.concurerency.publish;

import com.mmall.concurerency.annoations.NoThreadSafe;
import com.mmall.concurerency.annoations.NotRecommend;

@NoThreadSafe
@NotRecommend  //不推荐这样子写
public class Escape {

    private int thisCanBeEscape = 0;

    public Escape() {
        new InnerClass();
    }

    private class  InnerClass{
        public InnerClass(){
            //Escape.this    this引用的溢出
            System.out.println(Escape.this.thisCanBeEscape);
        }
    }

    public static void main(String[] args) {
        new Escape();
    }
}
